package team.stride.database.crud;
import team.stride.R;
import team.stride.database.StrideDB;
import team.stride.database.crud.imported.BDImportedActivity;
import team.stride.database.crud.music.BDMusicActivity;
import team.stride.database.crud.playlists.BDPlaylistsActivity;
import team.stride.database.crud.results.BDResultsActivity;
import team.stride.database.crud.tracks.BDTracksActivity;
import team.stride.database.crud.users.BDUsersActivity;
import team.stride.utils.UtilsStride;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;


public class BDActivity extends Activity
{
	private Button btnUsers;
	private Button btnImported;
	private Button btnResults;
	private Button btnTracks;
	private Button btnPlaylists;
	private Button btnMusic;
	
	private Button btnUsersf;
	private Button btnImportedf;
	private Button btnResultsf;
	private Button btnTracksf;
	private Button btnPlaylistsf;
	private Button btnMusicf;
	

	@Override
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.bd_layout);
		
		btnUsers = (Button) findViewById(R.id.bd_users_btn);
		btnImported = (Button) findViewById(R.id.bd_imported_btn);
		btnResults = (Button) findViewById(R.id.bd_results_btn);
		btnTracks = (Button) findViewById(R.id.bd_tracks_btn);
		btnPlaylists = (Button) findViewById(R.id.bd_playlists_btn);
		btnMusic = (Button) findViewById(R.id.bd_music_btn);
		
		btnUsersf = (Button) findViewById(R.id.bd_users_btnf);
		btnImportedf = (Button) findViewById(R.id.bd_imported_btnf);
		btnResultsf = (Button) findViewById(R.id.bd_results_btnf);
		btnTracksf = (Button) findViewById(R.id.bd_tracks_btnf);
		btnPlaylistsf = (Button) findViewById(R.id.bd_playlists_btnf);
		btnMusicf = (Button) findViewById(R.id.bd_music_btnf);
		
		
		btnUsers.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				startActivity(new Intent(v.getContext(), BDUsersActivity.class));
			}
		});
		
		btnImported.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				startActivity(new Intent(v.getContext(), BDImportedActivity.class));
			}
		});
		btnResults.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				startActivity(new Intent(v.getContext(), BDResultsActivity.class));
			}
		});
		btnTracks.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				startActivity(new Intent(v.getContext(), BDTracksActivity.class));
			}
		});
		
		btnPlaylists.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				startActivity(new Intent(v.getContext(), BDPlaylistsActivity.class));
			}
		});
		btnMusic.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				startActivity(new Intent(v.getContext(), BDMusicActivity.class));
			}
		});
		
		
		
		// fill
		btnUsersf.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				UtilsStride.fillRandomDB(StrideDB.MATCH_U, 5);
			}
		});
		
		btnImportedf.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				UtilsStride.fillRandomDB(StrideDB.MATCH_I, 5);
			}
		});
		btnResultsf.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				UtilsStride.fillRandomDB(StrideDB.MATCH_R, 5);
			}
		});
		btnTracksf.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				UtilsStride.fillRandomDB(StrideDB.MATCH_T, 5);
			}
		});
		
		btnPlaylistsf.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				UtilsStride.fillRandomDB(StrideDB.MATCH_P, 5);
			}
		});
		btnMusicf.setOnClickListener(new OnClickListener()
		{
			@Override
			public void onClick(View v)
			{
				UtilsStride.fillRandomDB(StrideDB.MATCH_M, 5);
			}
		});
		
	}
}
